package com.correo.vista.client.windows.event;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyVetoException;

import com.correo.vista.client.windows.Correo;

public class ActionListenerCerrarVentanasTodas implements ActionListener{

	private Correo correo;
	public ActionListenerCerrarVentanasTodas(Correo correo) {
		this.correo = correo;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		int cantidad= correo.getPanelPrincipal().getAllFrames().length;
		for(int i=0;i<cantidad;i++){
			try {
				correo.getPanelPrincipal().getAllFrames()[0].setClosed(true);
			} catch (PropertyVetoException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
		}
		
	}

}
